using System;
using System.Collections.Generic;
using System.Text;
using AntEater.ComponentModel.BuildElements;
using System.Collections.ObjectModel;
using AntEater.ComponentModel;

namespace AntEater.Runtime.Services.Transformation
{

    /// <summary>
    /// Result of an Transformation of a Build Xml File into the
    /// Build Element Component Model.
    /// </summary>
    public class XmlToBuildElementTransformationResult
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="T:XmlToBuildElementTransformationResult"/> class.
        /// </summary>
        /// <param name="buildFileDefinition">The build file definition.</param>
        /// <param name="errors">The errors.</param>
        internal XmlToBuildElementTransformationResult(BuildFileDefinition buildFileDefinition, List<TransformationError> errors) {
            this._buildFileDefinition = buildFileDefinition;
            this._errors = new ReadOnlyCollection<TransformationError>(errors);
        }

        private BuildFileDefinition _buildFileDefinition;

        /// <summary>
        /// Gets or sets the root build elements.
        /// </summary>
        /// <value>The root build elements.</value>
        public BuildFileDefinition BuildFileDefinition {
            get { return _buildFileDefinition; }
        }


        private ReadOnlyCollection<TransformationError> _errors;

        /// <summary>
        /// Gets or sets the errors.
        /// </summary>
        /// <value>The errors.</value>
        public ReadOnlyCollection<TransformationError> Errors {
            get { return _errors; }
        }

    }
}
